package com.ktjy.ktmall.domain;

import lombok.Data;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktjy.common.annotation.Excel;
import com.ktjy.common.core.domain.BaseEntity;

/**
 * 收货地址对象 t_address
 *
 * @author ktjy
 * @date 2025-01-13
 */
@Data
@TableName("t_address")
public class Address extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 地址编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private String id;

    /**
     * 会员编号
     */
    @Excel(name = "会员编号")
    @TableField(value = "user_id")
    private String userId;

    /**
     * 联系人
     */
    @Excel(name = "联系人")
    @TableField(value = "user_name")
    private String userName;

    /**
     * 手机
     */
    @Excel(name = "手机")
    @TableField(value = "tel_number")
    private String telNumber;

    /**
     * 邮政编码
     */
    @Excel(name = "邮政编码")
    @TableField(value = "postal_code")
    private String postalCode;

    /**
     * 省市区(格式为空格隔开)
     */
    @Excel(name = "省市区(格式为空格隔开)")
    @TableField(value = "fullLocation")
    private String fullLocation;

    /**
     * 国家码
     */
    @Excel(name = "国家码")
    @TableField(value = "national_code")
    private String nationalCode;

    /**
     * 国家
     */
    @Excel(name = "国家")
    @TableField(value = "country")
    private String country;

    /**
     * 省份
     */
    @Excel(name = "省份")
    @TableField(value = "province")
    private String province;

    /**
     * 城市
     */
    @Excel(name = "城市")
    @TableField(value = "city")
    private String city;

    /**
     * 地区
     */
    @Excel(name = "地区")
    @TableField(value = "district")
    private String district;

    /**
     * 详细地址
     */
    @Excel(name = "详细地址")
    @TableField(value = "detail")
    private String detail;

    /**
     * 删除标识字段(0-未删除 1-已删除)
     */
    @TableField(value = "enabled")
    private Long enabled;

    /**
     * 默认地址 0：否；1：是
     */
    @TableField(value = "is_default")
    private Long isDefault;

    /**
     * 会员信息表
     */
    @TableField(exist = false)
    private WxUser wxUser;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("userName", getUserName())
                .append("telNumber", getTelNumber())
                .append("postalCode", getPostalCode())
                .append("fullLocation", getFullLocation())
                .append("nationalCode", getNationalCode())
                .append("country", getCountry())
                .append("province", getProvince())
                .append("city", getCity())
                .append("district", getDistrict())
                .append("detail", getDetail())
                .append("enabled", getEnabled())
                .append("isDefault", getIsDefault())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("createBy", getCreateBy())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark()).append("wxUser", getWxUser())
                .toString();
    }
}